﻿<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="Bookmark" href="favicon.ico" >
	<link rel="Shortcut Icon" href="favicon.ico" />
	<!--[if lt IE 9]>
	<script type="text/javascript" src="/lib/html5.js"></script>
	<script type="text/javascript" src="/lib/respond.min.js"></script>
	<![endif]-->
	<link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="/lib/Hui-iconfont/1.0.9/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="/static/business/css/style.css" />
	<!--[if IE 6]>
	<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
	<script>DD_belatedPNG.fix('*');</script><![endif]-->
	<!--/meta 作为公共模版分离出去-->

	<title>人员列表 - 人员你管理 </title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<style>
		body{
			background:url(/temp/bg.png);
		}
	</style>
</head>
<body>
	<div class="wap-container">
		<nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
			首页
			<span class="c-gray en">/</span>
			人员管理
			<span class="c-gray en">/</span>
			人员列表
			<a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
		</nav>
		<article class="Hui-admin-content clearfix" style="opacity:0.9;">
			<div class="panel">
				<div class="panel-body">
					<div class="clearfix">
							<span class="col-xs-1 form-item-control" style="padding: 0px">
								<span class="select-box">
									<select id="classifyID" name="" class="select">
										<option value="0">姓名</option>
										<option value="1">工号</option>
										<option value="2">电话</option>
									</select>
								</span>
							</span>

							<span class="col-xs-2 form-item-control">
								<input type="text" name="searchInput" id="search-input" placeholder=" 请输入搜索的内容" class="input-text" />
							</span>
						<div class="col-xs-2">
							<div class=" ">
								<span class="col-xs-1 form-item-control">
									<button name="" id="search-submit" class="btn btn-success radius" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜一搜</button>
								</span>
							</div>
						</div>
						<div class="col-xs-2 ">
							<div class="row clearfix">
								<span class="col-xs-2 form-item-control">
									<button onclick="houseKeeperSearch('人员筛选','/houseKeeper/toSearch');" class="btn btn-success radius" type="button"><i class="Hui-iconfont">&#xe665;</i> 筛选</button>
								</span>
							</div>
						</div>
					</div>
				</div>
			</div>
			<input type="hidden" id="isMy" value="all">
			<input type="hidden" id="url" value="/houseKeeper/list/">
			<div class="panel mt-20">
				<div class="panel-body ">
					<div class="btn-group f-l">
						<span id="myHouseKeeperall" class="btn btn-primary radius" onclick="myHouseKeeper('all');">全部简历</span>
						<span  id="myHouseKeepermy" class="btn radius"  onclick="myHouseKeeper('my');">我的收藏</span>
					</div>
					<div class="skin-minimal f-l" >
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<div class="radio-box">
							<input type="radio" id="orderby-1" name="orderby" value="createdate" checked>
							<label for="orderby-1">按新增时间排序</label>
						</div>
						<div class="radio-box" >
							<input type="radio" id="orderby-2" name="orderby" value="recommendall">
							<label for="orderby-2">按推荐次数排序</label>
						</div>
					</div>

					<div class="clearfix">
						<span class="f-l">
						</span>
						<span class="f-r">共有数据：<strong id="total"></strong> 条</span>
					</div>

					<div class="mt-20 clearfix">
						<table id="data-table-list" class="table table-border table-bordered table-bg table-hover table-sort">
							<thead>
								<tr class="text-c">
									<th width="10"><input type="checkbox" name="" value=""></th>
									<th width="5">序号</th>
									<th width="80">头像</th>
									<th width="80">个人信息</th>
									<th width="80">基本信息</th>
									<th width="80">求职信息</th>
									<th width="80">简历状态</th>
									<th width="10">操作</th>
								</tr>
							</thead>
							<tbody class="getData-list" data-currPage='1'>

							</tbody>
						</table>
					</div>
					<div id="laypage" class="text-c"></div>
				</div>
			</div>
		</article>
	</div>

	<!--_footer 作为公共模版分离出去-->
	<script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="/lib/layer/3.1.1/layer.js"></script>
	<script type="text/javascript" src="/static/h-ui/js/H-ui.min.js"></script>
	<!--/_footer /作为公共模版分离出去-->

	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript" src="/lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="/lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="/static/business/js/main.js"></script>
	<!--/请在上方写此页面业务相关的脚本-->
	<script type="text/javascript">
		/* =====所有的列表页都可照搬这套模式====== */
		// 获取URL参数，初始化条件
		function getUrlParameter(){
			 //parseQueryString(); //方法 在main.js中 提取URL参数为对象
			var urlObj = parseQueryString(window.location.href);
			// console.log(urlObj);

			$("#classifyID").val(urlObj.classifyID);
			$(".getData-list").attr("data-currPage",urlObj.currPage)
			$("#search-datetime-start").val(urlObj.datetimeStart);
			$("#search-datetime-end").val(urlObj.datatimeEnd);
			$("#search-input").val(urlObj.keywords);
		}
		// 封装一个获取数据列表的方法，将条件封装到options对象中
		function getDataList(options){
			$.ajax({
				url: $("#url").val(),// 跳转到 action, 换成自己的接口
				data: options,
				type: 'post',
				cache: false,
				dataType: 'json', // 不一定非要json，可以是html，后台封好结构后，直接扔前台
				success: function(respData) {
					if(respData.result){ // 请求正确 返回true, 也指200状态
						var data = respData.datas; // 返回的数据
						var htmlstr = '';
						if(data.length > 0 ) {
							// 只有获取的数据对象长度大于0，我们才做for循环处理。
							for(var i = 0;i< data.length;i++){ // for循环将json数据拼接成html结构。 此处可以用模板引擎。
								var date=data[i];
                                console.log("-------"+date);
                                var highgrade =date.highgrade;
                                console.log("-------"+date.highgrade);
                                if(highgrade=="1"){
                                    highgrade="优质";
                                }
                                var workpic=date.workpic==null?"":date.workpic;
                                var name=date.name==null?"":date.name;
                                var phone1=date.phone1==null?"":date.phone1;

                                phone1= phone1.substring(0, 3) + "****" + phone1.substring(7, 11)
                                var salarystart=date.salarystart==null?"":date.salarystart;
                                var salaryend=date.salaryend==null?"":date.salaryend;
                                var workarea=date.workarea==null?"":date.workarea;
                                var id=date.id==null?"":date.id;

								var professional=getProfessional(date.professional);
                                var exp=getExp(date.experience);
                                var nativePlace=getNativePlace(date.nativeplace);
                                var education=getEducation(date.education);
                                var boardandlodging=getBoardandlodging(date.boardandlodging);
                                var language=getLanguage(date.language);
                                var cook=getCook(date.cook);
                                var worktype=getWorktype(date.worktype);
                                var worktime=getWorktime(date.worktime);
                                var workstate=getWorkstate(date.workstate);
                                var collect=date.collect;
                                var collectall=date.collectall;
                                var recommendall=date.recommendall;
                                var houseKeeperId=date.housekeeperid;
                                var ismy= $('#isMy').val();
                                    htmlstr += '<tr class="text-c">'+
                                        '<td><input type="checkbox" value="" name=""></td>'+
                                        '<td>'+ (i+1) +'</td>'+
                                        '<td>'+ '<img width="100" class="picture-thumb" onerror="onerror=null;src=\'/temp/default.jpg\'" src="'+workpic+'"/></td>'+
                                        '<td style="text-align:left;">'+
											'姓名:'+name +'<br/>'+
											'电话:'+phone1 +'<br/>'+
											'优质:'+highgrade +'<br/>'+
											'专业:'+professional+'<br/>'+
											'经验:'+exp+'</td>'+
                                        '<td style="text-align:left;">'+
											'籍贯:'+nativePlace+'<br/>'+
											'学历:'+education +'<br/>'+
											'食宿:'+boardandlodging +'<br/>'+
											'语言:'+language +'<br/>'+
											'做饭:'+cook +'</td>'+
                                        '<td style="text-align:left;">'+
											'工作类型:'+worktype +'<br/>'+
											'工作时间:'+worktime +'<br/>'+
											'工作状态:'+workstate +'<br/>'+
											'工资待遇:'+salarystart+'-'+salaryend+'<br/>'+
											'工作区域:'+workarea  +
										'</td>'+
                                        '<td>'+
											'收藏人数：<span style="color: #5eb95e">'+collectall+'</span>次<br/>' +
											'近期推荐：<span style="color: #5eb95e">'+recommendall+'</span>次<br/>' +
											'近期邀约：3次<br/>' +
											'签约客户：1个<br/>' +
										'</td>';

									htmlstr += '<td class="f-14 td-manage">';


                                if(ismy=="my"){
                                    htmlstr += '<a style="text-decoration:none" class="ml-5" onClick="edit(\''+id+'\');" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>&nbsp;' ;
                                    htmlstr +='<a style="text-decoration:none" class="ml-5" onClick="article_show_my(\''+id+'\');" href="javascript:;" title="查看"><i class="Hui-iconfont">&#xe725;</i></a>';
                                }else{
                                    htmlstr += '<a style="text-decoration:none" class="ml-5" onClick="edit(\''+id+'\');" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>&nbsp;' ;
                                    htmlstr +='<a style="text-decoration:none" class="ml-5" onClick="article_show(\''+id+'\');" href="javascript:;" title="查看"><i class="Hui-iconfont">&#xe725;</i></a>';
                                }


                                	if(collect!="0"){
                                        if(ismy=="my"){
                                            htmlstr+='<a style="text-decoration:none" class="ml-5" onClick="collect_del(\''+houseKeeperId+'\',\''+id+'\');" href="javascript:;" title="取消收藏"><i class="Hui-iconfont">&#xe630;</i></a>&nbsp;' ;
										}else{
                                            htmlstr+='<a style="text-decoration:none" class="ml-5" onClick="collect_del(\''+id+'\',\''+null+'\');" href="javascript:;" title="取消收藏"><i class="Hui-iconfont">&#xe630;</i></a>&nbsp;' ;
										}
									}else{
                                        htmlstr+='<a style="text-decoration:none" class="ml-5" onClick="collect_add(\''+id+'\');" href="javascript:;" title="收藏"><i class="Hui-iconfont">&#xe61b;</i></a>&nbsp;' ;

                                    }

									htmlstr += '</td>'+
								'</tr>';
							}
							// 在页面对应<tbody class=".getData-list">标签中输出拼接好的html结构。
							$(".getData-list").html(htmlstr);
							// 渲染分页
                            console.log("respData.currPage="+respData.currPage);
                            $("#total").html(respData.total);
							laypage({
						    cont: 'laypage',    //容器。值支持id名、原生dom对象，jquery对象。【如该容器为】：&lt;div id="laypage">&lt;/div>
						    pages: Math.ceil(respData.total/respData.pageSize),  // 除法运算，向上取整
						    curr: respData.currPage,    //初始化当前页
						    hash: 'page',
						    limits: [10, 25, 50, 100],
						    first: '首页',
						    last: '尾页',
						    prev: '<em>&lt;&lt;</em>',
						    next: '<em>&gt;&gt;</em>',
						    jump: function(e, first){ //触发分页后的回调
						      if(!first) {
										$(".getData-list").attr("data-currPage", e.curr);
										runGetDataList();
						      }
						    }
						  });

                        }else {
							console.log(respData.msg); // 返回正确状态，但是没有数据，在此处处理。
							var tdNum = $("#data-table-list thead tr td").length;
							htmlstr = '<tr><td colspan="'+tdNum+'" class="data-null">数据为空</td></tr>';
							$(".getData-list").html(htmlstr);
						}
					}else {
						console.log(respData.msg);  // 返回错误状态，通常指网络请求失败、后台报错等，最好后台给出错误提示，方便前台调试。也可定义几种返回的错误状态码，如201 203 400 404 500 503等。
					}
				},
				error: function(respData){ // ajax的error状态
					console.log(respData);
				}
			});
		}

		// 运行获取数据列表这个方法，这里面可以灵活自定义要传递的参数
		function runGetDataList(){
			getDataList({
				classifyID : $("#classifyID").val() || '0', // 分类id
				currPage : $(".getData-list").attr("data-currPage") || 1, // 当前第几页
				pageSize: 10, // 每页几条
				datetimeStart : $("#search-datetime-start").val() || '',
				datatimeEnd : $("#search-datetime-end").val() || '',
				keywords : $("#search-input").val() || '',
				orderby : $('input:radio[name="orderby"]:checked').val() || '',
                collect : $('#isMy').val() || ''
			});
		}

		$(function(){
			runDatetimePicker(); // 实例化日期控件
			getUrlParameter(); // 获取URL参数，初始化条件


			 runGetDataList(); // 页面载入，自执行加载数据...
			// 点击搜索执行...
			$("#search-submit").on("click",function(){
				 runGetDataList();
			});
            // 复选框样式
            $('.skin-minimal input').iCheck({
                checkboxClass: 'icheckbox-blue',
                radioClass: 'iradio-blue',
                increaseArea: '100%'
            });

            $("#orderby-1").on("click", function () {
                $('#search-submit').click();
            });$("#orderby-2").on("click", function () {
                $('#search-submit').click();
            });

		});

		function getProfessional(arrStr) {
            var professional =arrStr;
		    var professionalStr = "";
            if(professional!='undefined'&&professional!=""){
                var arr=professional.split(",");
                console.log(arr);
                for(var i=0;i<arr.length;i++){
                    if(arr[i]=="1"){
                        professionalStr=professionalStr+"育婴师"+",";
                    }
                    if(arr[i]=="2"){
                        professionalStr=professionalStr+"月嫂"+",";
                    }
                    if(arr[i]=="3"){
                        professionalStr=professionalStr+"家务助理"+",";
                    }
                    if(arr[i]=="4"){
                        professionalStr=professionalStr+"全能阿姨"+",";
                    }
                    if(arr[i]=="5"){
                        professionalStr=professionalStr+"老年看护"+",";
                    }
                    if(arr[i]=="6"){
                        professionalStr=professionalStr+"涉外家政"+",";
                    }
                    if(arr[i]=="7"){
                        professionalStr=professionalStr+"家庭司机"+",";
                    }
                    if(arr[i]=="8"){
                        professionalStr=professionalStr+"儿童家教"+",";
                    }
                    if(arr[i]=="9"){
                        professionalStr=professionalStr+"家庭厨师"+",";
                    }
                }
                professionalStr = professionalStr.substring(0, professionalStr.length - 1);
            }
			return professionalStr;
        }
        function getExp(str) {
			if(str!=null&&str!=""){
				if(str=="1"){
					return "新手";
				}
                if(str=="2"){
                    return "3年以下";
                }
                if(str=="3"){
                    return "3-5年";
                }
                if(str=="4"){
                    return "5年以上";
                }
                if(str=="5"){
                    return "10年以上";
                }
			}
        }
        function getNativePlace(str) {
            if(str!=null&&str!=""){
                if(str=="1"){
                    return "北京市";
                }
                if(str=="2"){
                    return "天津市";
                }
                if(str=="3"){
                    return "上海市";
                }
                if(str=="4"){
                    return "重庆市";
                }
                if(str=="5"){
                    return "黑龙江";
                }
                if(str=="6"){
                    return "吉林省";
                }
                if(str=="7"){
                    return "辽宁省";
                }
                if(str=="8"){
                    return "河北省";
                }
                if(str=="9"){
                    return "河南省";
                }
                if(str=="10"){
                    return "山东省";
                }
                if(str=="11"){
                    return "山西省";
                }
                if(str=="12"){
                    return "安徽省";
                }
                if(str=="13"){
                    return "江西省";
                }
                if(str=="14"){
                    return "江苏省";
                }
                if(str=="15"){
                    return "浙江省";
                }
                if(str=="16"){
                    return "福建省";
                }
                if(str=="17"){
                    return "广东省";
                }
                if(str=="18"){
                    return "湖南省";
                }
                if(str=="19"){
                    return "湖北省";
                }
                if(str=="20"){
                    return "海南省";
                }
                if(str=="21"){
                    return "云南省";
                }
                if(str=="22"){
                    return "贵州省";
                }
                if(str=="23"){
                    return "四川省";
                }
                if(str=="24"){
                    return "青海省";
                }
                if(str=="25"){
                    return "甘肃省";
                }
                if(str=="26"){
                    return "陕西省";
                }
                if(str=="27"){
                    return "内蒙古";
                }
                if(str=="28"){
                    return "新疆";
                }
                if(str=="29"){
                    return "广西";
                }
                if(str=="30"){
                    return "宁夏";
                }
                if(str=="31"){
                    return "西藏";
                }
                if(str=="32"){
                    return "香港";
                }
                if(str=="33"){
                    return "澳门";
                }
                if(str=="34"){
                    return "台湾";
                }
                if(str=="35"){
                    return "海外地区";
                }
                if(str=="36"){
                    return "菲律宾";
                }
                if(str=="37"){
                    return "印尼";
                }
                if(str=="38"){
                    return "缅甸";
                }
                if(str=="39"){
                    return "泰国";
                }
            }
        }
        function getEducation(str) {
            if(str!=null&&str!=""){
                if(str=="1"){
                    return "初中";
                }
                if(str=="2"){
                    return "高中";
                }
                if(str=="3"){
                    return "中专";
                }
                if(str=="4"){
                    return "大专";
                }
                if(str=="5"){
                    return "本科";
                }
                if(str=="6"){
                    return "本科以上";
                }
                if(str=="7"){
                    return "其他";
                }
            }
        }
        function getBoardandlodging(str) {
            if(str!=null&&str!=""){
                if(str=="1"){
                    return "不限";
                }
                if(str=="2"){
                    return "可住家";
                }
                if(str=="3"){
                    return "不住家";
                }
            }
        }
        function getLanguage(arrStr) {
            var language =arrStr;
            var languageStr = "";
            if(language!='undefined'&&language!=""){
                var arr=language.split(",");
                console.log(arr);
                for(var i=0;i<arr.length;i++){
                    if(arr[i]=="1"){
                        languageStr=languageStr+"普通话"+",";
                    }
                    if(arr[i]=="1"){
                        languageStr=languageStr+"四川话"+",";
                    }
                    if(arr[i]=="3"){
                        languageStr=languageStr+"上海话"+",";
                    }
                    if(arr[i]=="4"){
                        languageStr=languageStr+"东北话"+",";
                    }
                    if(arr[i]=="5"){
                        languageStr=languageStr+"广东话"+",";
                    }
                    if(arr[i]=="6"){
                        languageStr=languageStr+"客家话"+",";
                    }
                    if(arr[i]=="7"){
                        languageStr=languageStr+"闽南话"+",";
                    }
                    if(arr[i]=="8"){
                        languageStr=languageStr+"英语"+",";
                    }
                    if(arr[i]=="9"){
                        languageStr=languageStr+"日语"+",";
                    }
                    if(arr[i]=="10"){
                        languageStr=languageStr+"其他外语"+",";
                    }
                }
                languageStr = languageStr.substring(0, languageStr.length - 1);
            }
            return languageStr;
        }
        function getCook(arrStr) {
            var cook =arrStr;
            var cookStr = "";
            if(cook!='undefined'&&cook!=""){
                var arr=cook.split(",");
                console.log(arr);
                for(var i=0;i<arr.length;i++){
                    if(arr[i]=="1"){
                        cookStr=cookStr+"上海菜"+",";
                    }
                    if(arr[i]=="2"){
                        cookStr=cookStr+"浙江菜"+",";
                    }
                    if(arr[i]=="3"){
                        cookStr=cookStr+"川菜"+",";
                    }
                    if(arr[i]=="4"){
                        cookStr=cookStr+"粤菜"+",";
                    }
                    if(arr[i]=="5"){
                        cookStr=cookStr+"江苏菜"+",";
                    }
                    if(arr[i]=="6"){
                        cookStr=cookStr+"东北菜"+",";
                    }
                    if(arr[i]=="7"){
                        cookStr=cookStr+"鲁菜"+",";
                    }
                    if(arr[i]=="8"){
                        cookStr=cookStr+"潮州菜"+",";
                    }
                    if(arr[i]=="9"){
                        cookStr=cookStr+"湘菜"+",";
                    }
                    if(arr[i]=="10"){
                        cookStr=cookStr+"面食"+",";
                    }
                    if(arr[i]=="11"){
                        cookStr=cookStr+"西餐"+",";
                    }
                    if(arr[i]=="12"){
                        cookStr=cookStr+"海鲜"+",";
                    }
                    if(arr[i]=="13"){
                        cookStr=cookStr+"煲汤"+",";
                    }
                    if(arr[i]=="14"){
                        cookStr=cookStr+"其他"+",";
                    }
                }
                cookStr = cookStr.substring(0, cookStr.length - 1);
            }
            return cookStr;
        }
        function getWorktype(str) {
            if(str!=null&&str!=""){
                if(str=="1"){
                    return "全职";
                }
                if(str=="2"){
                    return "兼职";
                }

            }
        }
        function getWorktime(str) {
            if(str!=null&&str!=""){
                if(str=="1"){
                    return "全天24小时";
                }
                if(str=="2"){
                    return "07:00-19:00";
                }
                if(str=="3"){
                    return "07:00-12:00";
                }
                if(str=="4"){
                    return "12:00-14:00";
                }
                if(str=="5"){
                    return "12:00-19:00";
                }

            }
        }
        function getWorkstate(str) {
            if(str!=null&&str!=""){
                if(str=="1"){
                    return "待岗";
                }
                if(str=="2"){
                    return "上岗";
                }
                if(str=="3"){
                    return "培训中";
                }
                if(str=="4"){
                    return "已离职";
                }
                if(str=="5"){
                    return "黑名单";
                }

            }
        }
        function houseKeeperSearch(title,url){
            var index = layer.open({
                type: 2,
                title: title,
                content: url,
                area: ['1200px', '700px']
            });
        }
        //筛选回调
		function searchCallback(professionalValue,experienceValue,sexValue,agestartValue,ageendValue,zodiacValue,
								highgradeValue,nativeplaceValue,educationValue,boardandlodgingValue,languageValue,
								cookValue,worktypeValue,worktimeValue,workstateValue,salaryValue,workareaValue,
								certificateValue) {
            getDataList({
                classifyID : $("#classifyID").val() || '0', // 分类id
                currPage : $(".getData-list").attr("data-currPage") || 1, // 当前第几页
                pageSize: 10, // 每页几条
                datetimeStart : $("#search-datetime-start").val() || '',
                datatimeEnd : $("#search-datetime-end").val() || '',
                keywords : $("#search-input").val() || '',
                professionalValue : toStr(professionalValue),
                experienceValue : toStr(experienceValue),
                sexValue : toStr(sexValue),
                agestartValue : toStr(agestartValue),
                ageendValue : toStr(ageendValue),
                zodiacValue : toStr(zodiacValue),
                highgradeValue : toStr(highgradeValue),
                nativeplaceValue : toStr(nativeplaceValue),
                educationValue : toStr(educationValue),
                boardandlodgingValue : toStr(boardandlodgingValue),
                languageValue : toStr(languageValue),
                cookValue : toStr(cookValue),
                worktypeValue : toStr(worktypeValue),
                worktimeValue : toStr(worktimeValue),
                workstateValue : toStr(workstateValue),
                salaryValue : toStr(salaryValue),
                workareaValue : toStr(workareaValue),
                certificateValue : toStr(certificateValue),
                orderby : $('input:radio[name="orderby"]:checked').val() || '',
                collect : $('#isMy').val() || ''
            });
            //$("#search-submit").click();
        }
		function  toStr(arr) {
		    var str="";
		    for(var i=0;i<arr.length;i++){
		        str+=arr[i]+",";
			}
            str = str.substr(0, str.length - 1);
            return str;
        }
        function article_show_my(id){
            var index = layer.open({
                type: 2,
                title: "查看详情",
                content: "/houseKeeperMy/toShow?houseKeeperMyId="+id
            });
            layer.full(index);
        }
        function article_show(id){
            var index = layer.open({
                type: 2,
                title: "查看详情",
                content: "/houseKeeper/toShow?houseKeeperId="+id
            });
            layer.full(index);
        }
        /*收藏-删除*/
        function collect_del(id,houseKeeperMyId){
            layer.confirm('确认要取消收藏吗？',function(index){
                $.ajax({
                    url: '/collect/del/',// 跳转到 action, 换成自己的接口
                    data:{"houseKeeperId":id,"houseKeeperMyId":houseKeeperMyId,"state":"1"},
                    type: 'post',
                    cache: false,
                    dataType: 'json', // 不一定非要json，可以是html，后台封好结构后，直接扔前台
                    success: function(respData) {
                        if(respData.result){
                            layer.msg('取消收藏成功!',{icon:1,time:2000});

                            setTimeout(function () { location.replace(location.href) }, 2000);

                        }else{
                            layer.msg('取消收藏失败!',{icon:2,time:1000});
                        }
                    }
                });
            });
        }
        /*收藏-删除*/
        function collect_add(id){
            layer.confirm('确认要添加收藏吗？',function(index){
                $.ajax({
                    url: '/collect/add/',// 跳转到 action, 换成自己的接口
                    data:{"houseKeeperId":id,"state":"1"},
                    type: 'post',
                    cache: false,
                    dataType: 'json', // 不一定非要json，可以是html，后台封好结构后，直接扔前台
                    success: function(respData) {
                        if(respData.result){
                            layer.msg('添加收藏成功!',{icon:1,time:2000});
                            setTimeout(function () { location.replace(location.href) }, 2000);
                        }else{
                            layer.msg('添加收藏失败!',{icon:2,time:1000});
						}
                    }
                });
            });
        }
        function myHouseKeeper(isMy) {
			$('#isMy').val(isMy);

			if(isMy=="my"){
                $('#url').val('/houseKeeperMy/list/');
                $("#myHouseKeepermy").addClass("btn-primary");
                $("#myHouseKeeperall").removeClass("btn-primary");
			}else {
                $('#url').val('/houseKeeper/list/');
                $("#myHouseKeepermy").removeClass("btn-primary");
                $("#myHouseKeeperall").addClass("btn-primary");
			}
			$('#search-submit').click();

        }
        function edit(id){
            var isMy=$("#isMy").val();
            var url = "/houseKeeper/toEdit?houseKeeperId=";
            if(isMy=="my"){
                url="/houseKeeperMy/toEdit?houseKeeperId=";
            }
            var index = layer.open({
                type: 2,
                title: "人员编辑",
                content: url+id
            });
            layer.full(index);
        }



	</script>
</body>
</html>
